<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of PostsController
 *
 * @author Thiago
 */
class PostsController extends AppController{
  public $helpers = array('Html', 'Form');
  public $name = 'Posts';
  
  function index(){
    $this->set('posts', $this->Post->find('all'));
  }
  
  function view($id = null){
    $this->Post->id = $id;
    $this->set('post', $this->Post->read());
  }
  
  function add(){
    if($this->request->is('post')){
      if($this->Post->save($this->request->data)){
        
      }
    }
    
  }
  
  
}

?>
